home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / gold / menuClass.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  4.3 KB  |  183 lines

  1. /*
  2.  * The original copyright owners of the accompanying source code files have
  3.  * agreed to place such code into the public domain.  Accordingly, anyone
  4.  * who receives or obtains a copy of such source code is freely entitled to
  5.  * reproduce, use and otherwise exploit such code (including the right to
  6.  * make derivative works), at his/her own risk and expense, without any
  7.  * obligation or liability to the original copyright owners.
  8.  *
  9.  * We would appreciate (but do not require) that the following message be
  10.  * included in any derivative works:
  11.  *
  12.  * "Portions of this program were developed by Peter Broadwell, Rob Myers
  13.  * and Robin Schaufler while working in Silicon Valley."
  14.  *
  15.  * The accompanying source code files and related documentation materials
  16.  * are distributed on an "AS IS" basis, without any warranties or
  17.  * guarantees of any kind.  All implied warranties, including the implied
  18.  * warranties of merchantability and of fitness for any particular purpose,
  19.  * are expressly disclaimed.
  20.  */
  21. #include "gl.h"
  22.  
  23. #include "geom.h"
  24. #include "class.h"
  25. #include "classIds.h"
  26. #include "selectors.h"
  27. #include "mbox.h"
  28. #include "colors.h"
  29. #include "panel.h"
  30. #include "menu.h"
  31.  
  32. extern class panelClass;
  33.  
  34. extern char *selectMenu(), *drawMenu(), *eselMenu();
  35. extern char *cascadeMenu();
  36.  
  37. fcnTable menuTable[] = {
  38.     ENDSELECT,    eselMenu,    /* end picking on a menu           */
  39.     SELECT,    drawMenu,
  40.     TRANSACT,    selectMenu,
  41.     DRAWTRACKER,NULL,
  42.     EOTABLE,
  43. };
  44.  
  45. class menuClass = {
  46.     &panelClass,
  47.     menuTable,
  48.     sizeof(menu),
  49.     MENU,
  50. };
  51.  
  52. menu menuTemplate = {
  53.             /*   inst        */
  54.     &menuClass,        /* myClass pointer    */
  55.     NULL,        /* classFunctions     */
  56.     0,            /* nFunctions        */
  57.             /*   mailbox        */
  58.     NULL,        /* subscribers          */
  59.     NULL,        /* subscribedTo         */
  60.                 /*   panel              */
  61.     NULL,        /* next            */
  62.     NULL,        /* kids            */
  63.     NULL,        /* dad            */
  64.     0,0,0,0,        /* area            */
  65.     NULL,        /* painter        */
  66.             /*   menu        */
  67.     0,0,        /* nbuttons        */
  68.     0,            /* curVal        */
  69.     NULL,        /* receiver        */
  70.     0,            /* baseSelect        */
  71.     NULL,        /* highlight        */
  72. };
  73.  
  74. fcnTable bhmenuTable[] = {
  75.     TRANSACT,    cascadeMenu,
  76.     EOTABLE,
  77. };
  78.  
  79. class bhmenuClass = {
  80.     &menuClass,
  81.     menuTable,
  82.     sizeof(menu),
  83.     BHMENU,
  84. };
  85.  
  86. menu bhmenuTemplate = {
  87.             /*   inst        */
  88.     &bhmenuClass,    /* myClass pointer    */
  89.     NULL,        /* classFunctions     */
  90.     0,            /* nFunctions        */
  91.             /*   mailbox        */
  92.     NULL,        /* subscribers          */
  93.     NULL,        /* subscribedTo         */
  94.                 /*   panel              */
  95.     NULL,        /* next            */
  96.     NULL,        /* kids            */
  97.     NULL,        /* dad            */
  98.     0,0,0,0,        /* area            */
  99.     NULL,        /* painter        */
  100.             /*   menu        */
  101.     0,0,        /* nbuttons        */
  102.     0,            /* curVal        */
  103.     NULL,        /* receiver        */
  104.     0,            /* baseSelect        */
  105.     NULL,        /* highlight        */
  106. };
  107.  
  108. extern char *selectChoice(), *drawChoice();
  109.  
  110. fcnTable choiceTable[] = {
  111.     SELECT,    selectChoice,
  112.     TRANSACT,    NULL,
  113.     DRAWTRACKER,drawChoice,
  114.     EOTABLE,
  115. };
  116.  
  117. class choiceClass = {
  118.     &panelClass,
  119.     choiceTable,
  120.     sizeof(choice),
  121.     CHOICE,
  122. };
  123.  
  124. choice choiceTemplate = {
  125.             /*   inst        */
  126.     &choiceClass,    /* myClass pointer    */
  127.     NULL,        /* classFunctions     */
  128.     0,            /* nFunctions        */
  129.             /*   mailbox        */
  130.     NULL,        /* subscribers          */
  131.     NULL,        /* subscribedTo         */
  132.                 /*   panel              */
  133.     NULL,        /* next            */
  134.     NULL,        /* kids            */
  135.     NULL,        /* dad            */
  136.     0,0,0,0,        /* area            */
  137.     NULL,        /* painter        */
  138.             /*   menu        */
  139.     0,0,        /* nbuttons        */
  140.     0,            /* curVal        */
  141.     NULL,        /* baseChoice        */
  142.     NULL,        /* value        */
  143.     NULL,        /* highlight        */
  144. };
  145.  
  146. extern char *selectChoicef(), *drawChoicef();
  147.  
  148. fcnTable choicefTable[] = {
  149.     SELECT,    selectChoicef,
  150.     TRANSACT,    NULL,
  151.     DRAWTRACKER,drawChoicef,
  152.     EOTABLE,
  153. };
  154.  
  155. class choicefClass = {
  156.     &panelClass,
  157.     choicefTable,
  158.     sizeof(choicef),
  159.     CHOICEF,
  160. };
  161.  
  162. choicef choicefTemplate = {
  163.             /*   inst        */
  164.     &choicefClass,    /* myClass pointer    */
  165.     NULL,        /* classFunctions     */
  166.     0,            /* nFunctions        */
  167.             /*   mailbox        */
  168.     NULL,        /* subscribers          */
  169.     NULL,        /* subscribedTo         */
  170.                 /*   panel              */
  171.     NULL,        /* next            */
  172.     NULL,        /* kids            */
  173.     NULL,        /* dad            */
  174.     0,0,0,0,        /* area            */
  175.     NULL,        /* painter        */
  176.             /*   menu        */
  177.     0,0,        /* nbuttons        */
  178.     0,            /* curVal        */
  179.     NULL,        /* baseChoice        */
  180.     NULL,        /* value        */
  181.     NULL,        /* highlight        */
  182. };
  183.